<?php
namespace app\oauth2\controller;
use app\admin\common\Common;
require_once("QQSDK/qqConnectAPI.php");
class Login{
    public static function index($type,$state){
        if ($state =="fore_end_login"||$state =="back_end_band"){
            //前端登录或者后端绑定
            $qc = new \QC();
            $state = base64_encode($state);
            //$qc->qq_login($state);
            $data = array(
                'type' => $type,
                'state' => $state,
                'url' => $qc->qq_login($state)
            );
            //header("refresh:5;".$data['url']);
            return Common::result(200,"success",$data);
        }else{
            return Common::result(500,"type:".$type."<br>state:". $state.'<br>不存在的登录方式或state出现问题，请停止对本站的攻击');
        }
    }
}